<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateActRechargeLimitTable extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('act_recharge_limit', function (Blueprint $table) {
            $table->increments('id');
            $table->unsignedInteger('user_id')->default(0)->comment('用户ID');
            $table->unsignedSmallInteger('recharge_rmb')->default(0)->comment('活动充值金额');
            $table->unsignedSmallInteger('recharge_coin')->default(0)->comment('活动充值金币');
            $table->unsignedTinyInteger('type')->default(1)->comment('类型：1-新人，2-老用户');
            $table->timestamps();
            $table->unsignedTinyInteger('flag')->default(1);
            $table->index('user_id', 'user_id');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('act_recharge_limit');
    }
}
